package com.wzcl.app.dao.model;

import com.wzcl.app.dao.model.common.Promotion;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;

@Data
@Entity
@Table(name = "ActivityGroupPromotion",
        uniqueConstraints = {
                @UniqueConstraint(columnNames = {"activityId", "orderNo"})
        }
)
@ApiModel(value = "拼团活动")
@EntityListeners(AuditingEntityListener.class)
public class ActivityGroupPromotion implements Promotion {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ApiModelProperty(value = "活动Id")
    private Integer activityId;

    @ApiModelProperty(value = "满人数")
    private BigDecimal groupSize;

    @ApiModelProperty(value = "成团时间")
    private Long time;

    @ApiModelProperty(value = "价格")
    private BigDecimal value;

    @ApiModelProperty(value = "排序字段")
    private Integer orderNo;
}
